import { http } from '@/utils/http'

/** GET 请求 */
// 获取会员中心信息
export const getUserIndexAPI = () => {
  return http.get('/api/user/index')
}

// POST 会员登录 /api/user/login
export const postLoginAPI = (data) => {
  return http.post('/api/user/login', data)
}

// POST 注册会员 /api/user/register
export const postRegisterAPI = (data) => {
  return http.post('/api/user/register', data)
}

// POST 会员详情 /api/user/detail
export const postUserDetailAPI = (data) => {
  return http.post('/api/user/detail', data)
}

// POST 退出登录 /api/user/logout
export const postLogoutAPI = () => {
  return http.post('/api/user/logout')
}

// POST 修改会员个人信息 /api/user/profile
export const postUpdateProfileAPI = (profileData: any) => {
  return http.post('/api/user/profile', profileData)
}

// POST 重置密码 /api/user/resetpwd
export const postResetPasswordAPI = (data) => {
  return http.post('/api/user/resetpwd', data)
}


//设置积分价格 /api/manage/setPointsPrice
export const postSetPointsPriceAPI = (data) => {
  return http.post('/api/manage/setPointsPrice', data)
}
//设置30天购买商城总金额 /api/manage/setTotalPurchase
export const postSetTotalPurchaseAPI = (data) => {
  return http.post('/api/manage/setTotalPurchase', data)
}
// 获取30天购买商城总金额、积分价格 /api/manage/getConfig
export const getGetConfigAPI = () => {
  return http.get('/api/manage/getConfig')
}

//充值宝豆 /api/manage/rechargeCargoValue
export const postRechargeCargoValueAPI = (data) => {
  return http.post('/api/manage/rechargeCargoValue', data)
}
//宝豆扣减 /api/manage/minusCargoValue
export const postReduceCargoValueAPI = (data) => {
  return http.post('/api/manage/minusCargoValue', data)
}
//  转账积分到自己活动积分 /api/user/transferPointsToSelf
export const postTransferPointsToSelfAPI = (data) => {
  return http.post('/api/user/transferPointsToSelf', data)
}

//转账活动积分到他人活动积分 /api/user/transferPointsToOther
export const postTransferPointsToOtherAPI = (data) => {
  return http.post('/api/user/transferPointsToOther', data)
}

//获取积分记录 /api/user/getPointsList
export const getPointsListAPI = (data) => {
  return http.get('/api/user/getPointsList', data)
}

//获取活动积分记录 /api/user/getActivityPointsList
export const getActivityPointsListAPI = (data) => {
  return http.get('/api/user/getActivityPointsList', data)
}

//获取宝豆记录 /api/user/getCargoValueList
export const getCargoValueListAPI = (data) => {
  return http.get('/api/user/getCargoValueList', data)
}


//获取平台积分记录 /api/manage/getPointsList
export const getPlatformPointsListAPI = (data) => {
  return http.get('/api/manage/getPointsList', data)
}

//获取团队列表 /api/user/team_list
export const getTeamListAPI = (data) => {
  return http.get('/api/user/team_list', data)
}

// 地址列表 addons/jieziaddress/api/get_list
export const getAddressListAPI = (data?: any) => {
  return http.post('/addons/jieziaddress/api/get_list', data)
}

// 地址详细 addons/jieziaddress/api/info
export const getAddressInfoAPI = (data: any) => {
  return http.post('/addons/jieziaddress/api/info', data)
}

// 地址编辑 addons/jieziaddress/api/edit
export const postAddressEditAPI = (data: any) => {
  return http.post('/addons/jieziaddress/api/edit', data)
}

// 地址删除 addons/jieziaddress/api/del
export const postAddressDeleteAPI = (data: any) => {
  return http.post('/addons/jieziaddress/api/del', data)
}

// 设为默认 addons/jieziaddress/api/set_default
export const postSetDefaultAddressAPI = (data: any) => {
  return http.post('/addons/jieziaddress/api/set_default', data)
}

// 用户详细 /api/user/detail
export const userDetail = (data) => {
  return http.post('/api/user/detail', data)
}

// 修改会员个人信息 /api/user/profile
export const userProfile = (data) => {
  return http.post('/api/user/profile', data)
}

// 修改荣誉 /api/user/self_desc
export const userDesc = (data) => {
  return http.post('/api/user/self_desc', data)
}

// 省市区 addons/jieziarea/api/tree
export const getRegion = () => {
  return http.get('/addons/jieziarea/api/tree')
}

//商品列表 /api/goods/get_list
export const getGoodsListAPI = (data) => {
  return http.get('/api/goods/get_list', data)
}

//商品详细 /api/goods/get_detail  
export const getGoodsDetailAPI = (data) => {
  return http.get('/api/goods/get_detail', data)
}

//首页 /api/index/index
export const getIndexAPI = (data) => {
  return http.get('/api/index/index', data)
}

//订单列表 /api/order/get_list
export const getOrderListAPI = (data) => {
  return http.get('/api/order/get_list', data)
}

// 订单详细 /api/order/get_info 
export const getOrderDetailAPI = (data) => {
  return http.get('/api/order/get_info', data)
}

//下单 /api/order/quick_order
export const postOrderQuickOrderAPI = (data) => {
  return http.post('/api/order/quick_order', data)
}


//旧订单支付 /api/order/old_order_pay
export const postOldOrderPayAPI = (data) => {
  return http.post('/api/order/old_order_pay', data)
}

// 订单取消 /api/order/order_cancel 
export const postOrderCancelAPI = (data) => {
  return http.post('/api/order/order_cancel', data)
}

// auto_cancel /api/order/auto_cancel 
export const postAutoCancelAPI = (data) => {
  return http.post('/api/order/auto_cancel', data)
}

//获取用户信息  /api/manage/getUserData
export const getUserDataAPI = (data) => {
  return http.get('/api/manage/getUserData', data)
}

//轮播图 addons/jieziad/api/pos_info2
export const getPosInfo2API = (data) => {
  return http.get('/addons/jieziad/api/pos_info2?id=1', data)
}
//申请找回密码 /api/user/apply_find_pwd
export const postApplyFindPwdAPI = (data) => {
  return http.post('/api/user/apply_find_pwd', data)
}

//上传图片 /api/common/upload
export const postUploadAPI = (data) => {
  return http.post('/api/common/upload', data)
}
//申请找回支付密码 /api/user/apply_find_pay_pwd
export const postApplyFindPayPwdAPI = (data) => {
  return http.post('/api/user/apply_find_pay_pwd', data)
}

//管理员电话/api/user/common
export const getAdminTelAPI = () => {
  return http.get('/api/user/common')
}



//商品分/api/goods/get_cat
export const getCateListAPI = (data) => {
  return http.get('/api/goods/get_cat', data)
}
//充值积分  /api/manage/rechargePoints
export const postRechargeScoreAPI = (data) => {
  return http.post('/api/manage/rechargePoints', data)
}

//释放积分 /api/manage/release_points
export const postReleasePointsAPI = (data) => {
  return http.post('/api/manage/release_points', data)
}
 
